﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using websoniBO;

namespace websoni
{
    public partial class WebForm12 : System.Web.UI.Page
    {
        Fan f = new Fan();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dt = f.GetRecords(-99, "", "", "", false, " and ");
                DataList1.DataSource = dt;
                DataList1.DataBind();
            }

        }

        protected void btnok_Click(object sender, EventArgs e)
        {
            f.fid = -99;
            f.fanname = tbname.Text;
            if (FileUpload1.HasFile)
                FileUpload1.PostedFile.SaveAs(Server.MapPath("~/images/" + FileUpload1.FileName));
            f.fanphoto = FileUpload1.FileName;
            f.fdesc = tbdesc.Text;
            f.isdeleted = false;
            f.SaveRecords();
            Response.Redirect("~/Fanpage.aspx");
        }
    }
}
